#include "TextureIndex.h"
#include "vector2.h"
TextureIndex::TextureIndex(void)
{
	m_nTextureName = 0;
	m_nIndexInTexture = 0;
}
TextureIndex::TextureIndex(uint textureName, uint indexInTexture)
{
	m_nTextureName = textureName;
	m_nIndexInTexture = indexInTexture;
}
TextureIndex::~TextureIndex(void)
{
}
void TextureIndex::Set(uint textureName, uint indexInTexture)
{
	m_nTextureName = textureName;
	m_nIndexInTexture = indexInTexture;
}
uint TextureIndex::GetTextureName() const
{
	return m_nTextureName;
}
uint TextureIndex::GetIndex() const
{
	return m_nIndexInTexture;
}
vector2 TextureIndex::GetIndexXY(uint xDivisions) const
{
	uint xStep = m_nIndexInTexture % (int)xDivisions;
	uint yStep = (m_nIndexInTexture - xStep) / (int)xDivisions;
	return vector2(xStep, yStep);
}
